﻿Public Class clsSubSach
    Public Shared Function ThemTG(ByVal MaTG As String, ByVal MaSach As String, ByVal GhiChu As String) As Boolean
        Return db.Query("Insert into Sach_TacGia values('" & MaSach & "','" & MaTG & "','" & GhiChu & "')")
    End Function
    Public Shared Function SuaTG(ByVal MaTG As String, ByVal MaSach As String, ByVal GhiChu As String, ByVal oldMaTG As String) As Boolean
        Return db.Query("Update Sach_TacGia set MaTG='" & MaTG & "', GhiChu=N'" & GhiChu & "' where Masach ='" & MaSach & "' and MaTG='" & oldMaTG & "'") ' haiz, ma  cung co the suama tac gia, tuy nhien vi no co 3 pk nen phai where du ca 2
    End Function

    Public Shared Function XoaTG(ByVal MaSach As String, ByVal MaTG As String) As Boolean
        Return db.Query("Delete Sach_TacGia where MaTG='" & MaTG & "' and MaSach='" & MaSach & "'")

    End Function
 

End Class
